package rest.jbpm.wrappers.lists;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import rest.jbpm.wrappers.Choice;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "choices", propOrder = {"choices"})
public class ChoiceList {
    
	private List<Choice> choices;
	
	protected ChoiceList() {
		
	}
	
	public ChoiceList(Map<String,Number> chcs) {
		
		choices = new ArrayList<Choice>();
		
		for(String choice : chcs.keySet())
			choices.add(new Choice(choice, chcs.get(choice)));

	}
	
	@XmlElement(name="choice",required=true)
	public List<Choice> getChoices() {
		return choices;
	}
}
